import 'package:flutter/material.dart';
import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/widgets.dart';

class CardDemo extends StatefulWidget {
  const CardDemo({Key? key}) : super(key: key);

  @override
  State<CardDemo> createState() => _CardDemoState();
}

class _CardDemoState extends State<CardDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title:const Text("card 卡片") ,
        centerTitle: true,
      ),
      body: Column(
        children: [
          Text("Card是material风格的卡片控件，Card有较小的圆角和阴影。Card通常用于展示一组信息，比如相册、位置信息等。"),
          Card(
            color: Colors.blue, // 背景色
            elevation: 10, // 阴影
            shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), // 形状圆角矩形
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                const ListTile(
                  leading: Icon(Icons.album),
                  title: Text("Card"),
                  subtitle: Text("card 风格布局"),
                ),
                ButtonBar(
                  children: [
                    FlatButton(
                      textColor: Colors.white,
                      onPressed: (){}, 
                      child: Text("ok")
                    ),
                    FlatButton(
                      textColor: Colors.white,
                      onPressed: (){}, 
                      child: Text("非常对")
                      )
                  ],
                )
              ],
            ),
          )
        ],
      ),
    );
    
  }
}